<?php
/**
 * Created by PhpStorm.
 * User: nightelf
 * Date: 2020/6/22
 * Time: 15:59
 */

namespace App\Http\Model;


use Illuminate\Support\Facades\DB;

class SupplierOrdersReceivingInfoModel
{
    const TABLE = 'supplier_orders_receiving_info';

    public function insert(array $data2)
    {
        return DB::table(self::TABLE)->insert($data2);
    }

    public function lists(array $param)
    {
        return DB::table(self::TABLE)
            ->where(function($query) use ($param){
                $query->where('orderInfoId',$param['orderInfoId']);
            })
            ->get()->toArray();
    }

    public function info(array $data)
    {
        $result = DB::table(self::TABLE)->where($data)->first();
        return empty($result)?[]:get_object_vars($result);
    }
}